Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#91 display progression for on-going parent_tasks #96

Merged
merged 2 commits into from
Mar 30, 2022

Conversation

Skrattoune
Copy link
Contributor

Used for displaying parent_task progression in admin (cf #91)
when task is still on-going instead of just last signal

Used for displaying parent_task progression (cf boxine#91)
cf boxine#91:
displaying progression for parent_tasks if execution is on-going
(format: f'{obj.progress_count}/{obj.total}')
or last_signal
@codecov-commenter
Copy link

codecov-commenter commented Mar 24, 2022

Codecov Report

Merging #96 (2067695) into master (c2e5e21) will decrease coverage by 0.44%.
The diff coverage is 44.44%.

@@            Coverage Diff             @@
##           master      #96      +/-   ##
==========================================
- Coverage   83.31%   82.86%   -0.45%     
==========================================
  Files          40       40              
  Lines         809      817       +8     
==========================================
+ Hits          674      677       +3     
- Misses        135      140       +5     
Impacted Files Coverage Δ
huey_monitor/admin.py 72.22% <28.57%> (-4.71%) ⬇️
huey_monitor/constants.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c2e5e21...2067695. Read the comment docs.

@jedie
Copy link
Collaborator

jedie commented Mar 30, 2022

I revent these changes with #101
It seems that's not the right solution, yet.

e.g.:

With your PR:

grafik

Before the PR:

grafik

(We also see here that the 4it is in both cases a little confusing. Maybe you address this in #98 )

Think the problem is that we have two kind of "main/sub tasks", e.g.:

  • Subdivide a number of "jobs" into chunks and process these chunks parallelized. The one from the screenshot. It's the example tasks here:
    def parallel_sub_task(task, parent_task_id, item_chunk, **info_kwargs):
    """
    Useless example: Just calculate the SHA256 hash from all files
    """
    # Save relationship between the main and sub tasks:
    TaskModel.objects.set_parent_task(
    main_task_id=parent_task_id,
    sub_task_id=task.id
    )
    total_items = len(item_chunk)
    # Init progress information of this sub task:
    process_info = ProcessInfo(
    task, total=total_items, parent_task_id=parent_task_id, **info_kwargs
    )
    for entry in item_chunk:
    # ...do something with >entry< ...
    logger.info('process %s', entry)
    time.sleep(1)
    # Update sub and main task progress:
    process_info.update(n=1)
    logger.info('Chunk finish: %s', process_info)
  • Group different sub-task with different "total counts" (Your use-case, mention in Status of Parent task not depending on progress vs.total #91 )

Think the second one are not as an example in the DEMO project. We should add this and look if all changes are a good ideas for both cases!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants